<?php

namespace App\Http\Services;
/**
 * Created by PhpStorm.
 * User: thorjiang
 * Date: 2018/5/10
 * Time: 14:40
 */

use App\Models\BusinessModel;
use App\Models\UserModel;
use App\Models\UserTicketModel;

/**
 * build
 * Class MeetingDTOBuilderService
 * @package App\Http\Services
 */
class MeetingDTOBuilderService
{
    /**
     * buildTickets
     * @param $userId
     * @param $userickets
     * @return array
     */
    public static function buildMeeting($meetings)
    {
        $data = [];
        foreach ($meetings as $meeting) {

            //$meeting['arrangement'] = (string) $meeting['arrangement'];
           // $meeting['corps'] = (string) $meeting['corps'] ?? '';
           // $meeting['supporting'] = (string) $meeting['supporting'] ?? '';

            $data[] = $meeting;
        }

        return $data;
    }

    /**
     * @param $meeting
     * @return mixed
     */
    public static function build($meeting)
    {
        if (empty($meeting['category'])) {
            $meeting['category'] = [];
        } else {
            $meeting['category'] = json_decode($meeting['category'], true);
        }

        return $meeting;
    }
}
